<template>
  <div class="ql-editor">
    detail
    {{ noticeTitle }}
    <hr/>
    <div v-html="noticeContent"></div>
  </div>
</template>

<script>
import axios from "axios";

const BASE_URL = "http://124.222.238.167/prod-api"
const TOKEN = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImExOGJhOGQ1LTc0NjctNDM2Yi1iMTJlLTYxNGYxNGRiMTk4NCJ9.YNWN5At-Jhvsrw52pgacGlN8Io3xgKGwVsA1x4Z2zhHfmmcSLQBNWUi8wgVHF69Nx3TVsDNYJPb832F5eB4jkg"

export default {
  name: "NoticeDetail",
  data() {
    return {
      noticeTitle: '',
      noticeContent: ''
    }
  },
  methods: {
    selectNoticeApi(id) {
      axios({
        url: BASE_URL + "/system/notice/" + id,
        method: "GET",
        headers: {
          Authorization: TOKEN
        },
      }).then(res => {
        console.log(res.data)
        this.noticeTitle = res.data.data.noticeTitle
        this.noticeContent = res.data.data.noticeContent

      })
    }
  },
  created() {
    this.selectNoticeApi(this.$route.params.noticeId)
    // 系统路由对象
    console.log(this.$router)

    // 当前页面路由
    console.log(this.$route)
    console.log(this.$route.params.noticeId)
    // console.log(this.$route.params.noticeTitle)
    // console.log(this.$route.query.noticeId)
    console.log(this.$route.query.noticeTitle)
  }
}
</script>

<style scoped lang="scss">

</style>